﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Media.Imaging;

namespace Win.CSkin.Test
{
    public partial class FrmWinTouch : Form
    {
        public FrmWinTouch()
        {
            InitializeComponent();
        }

        private void FrmWinTouch_Load(object sender, EventArgs e)
        {
            System.Windows.Controls.Image m_Btn_zoomin = new System.Windows.Controls.Image()
            {
                Name = "Btn_zoomin"
            };
            var brush = new BitmapImage();
            brush.BeginInit();
            brush.UriSource = new Uri(@"F:\Doc\图标\lx-socket.png", UriKind.Absolute);
            brush.EndInit();
            m_Btn_zoomin.Source = brush;

            elementHost1.Child = m_Btn_zoomin;
            m_Btn_zoomin.AddHandler(System.Windows.Controls.Button.TouchEnterEvent, new System.Windows.RoutedEventHandler(touch_down), true);
            m_Btn_zoomin.AddHandler(System.Windows.Controls.Button.TouchUpEvent, new System.Windows.RoutedEventHandler(touch_up), true);
        }

        private void touch_down(object sender, RoutedEventArgs e)
        {
            //在此处写按下响应程序
            button1.Text = "touch down";
        }
        private void touch_up(object sender, RoutedEventArgs e)
        {
            //在此处写抬起响应程序
            button1.Text = "touch up";
        }

    }
}
